package com.kc.controller;


import com.kc.bean.Article;
import com.kc.service.IAccountLikeArticleService;
import com.kc.util.ResponesBean;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author jobob
 * @since 2019-10-26
 */
@RestController
@RequestMapping("/pet/account-like-article")
public class AccountLikeArticleController {

    @Resource
    private ResponesBean responesBean;

    @Resource
    private IAccountLikeArticleService accountLikeArticleService;

    @PostMapping("addattention")
    public ResponesBean addattention(@RequestBody Article article, HttpServletRequest request){
        //获取用户token
        String token = request.getHeader("AcessToken");

        responesBean = accountLikeArticleService.LikeArticle(article,token);
        return responesBean;
    }

}
